/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.wpi.first.wpilibj.defaultCode;

import edu.wpi.first.wpilibj.AnalogChannel;
import edu.wpi.first.wpilibj.PIDSource;

/**
 *
 * @author robotics
 */
public class MagneticEnc implements PIDSource {

    AnalogChannel raw;

    public MagneticEnc(int channel)
    {
        raw = new AnalogChannel(Constants.CRIO_ANALOG_BREAKOUT, channel);
    }
    
    public double pidGet() {
        int rawEnc = raw.getValue();

        return (rawEnc/1024)*360;
    }

}
